package com.youdianda.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.servers.ServerVariable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author xiaoyanggao
 * @since 2023-05-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("sys_user")
@ApiModel(value = "SysUser对象", description = "用户表")
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id",type = IdType.ASSIGN_UUID)
    @ApiModelProperty("编号")
    private String id;

    @ApiModelProperty("登录名")
    private String loginName;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("电话")
    private String phone;

    @ApiModelProperty("最后登陆IP")
    private String loginIp;

    @ApiModelProperty("最后登陆时间")
    private LocalDateTime loginDate;

    @JsonFormat(pattern =  "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private LocalDateTime createDate;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateDate;

    @ApiModelProperty("删除标记")
    private String delFlag;

    @ApiModelProperty("角色ID")
    private String roleId;

    @ApiModelProperty("状态 1 正常  0 冻结")
    private Integer status;

    @ApiModelProperty("是否为默认数据，null表示不是，1表示是--")
    private String defaultData;

    //不影响数据库
    @TableField(exist = false)
    private List<String> rolename;

}
